package real.lang.literal;

import java.util.EnumSet;

import real.lang.RealLangException;
import real.lang.RealLiteral;
import real.lang.reflect.EnumerationOfRealSubtypes;
import real.lang.reflect.EnumerationOfRealTypes;
import real.lang.reflect.RealRTI;
import real.lang.reflect.RealType;
import real.lang.reflect.RealTypeSignature;

public class RealBoolean extends RealLiteral {

	public RealBoolean(RealType type) {
		super(type);
	}
	
	public RealBoolean(boolean value) throws RealLangException {		
		super(RealRTI.getInstance().GetType(getRealTypeSignature(RealRTI.DEFAULT_TYPE_SPACE)));
		this.setValue(value);
	}	
	
	public static RealTypeSignature getRealTypeSignature(String typeSpace) {
		RealTypeSignature signature = new RealTypeSignature(
				EnumerationOfRealTypes.LITERAL, 
				EnumSet.of(EnumerationOfRealSubtypes.BOOLEAN), typeSpace);
		return signature;
	}

	private boolean value;
	
	/**
	 * @param value the value to set
	 */
	public void setValue(boolean value) {
		this.value = value;
	}

	/**
	 * @return the value
	 */
	public boolean getValue() {
		return value;
	}
	
}
